<?xml version="1.0" encoding="utf-8"?>

<EFFECT xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns ="urn:dsfx0">
  
  <DST_STATE_GROUP>
    <NAME>DepthNoTestNoWrite</NAME>
    <DEPTH_ENABLE>false</DEPTH_ENABLE>
    <DEPTH_WRITE>false</DEPTH_WRITE>
  </DST_STATE_GROUP>

	<BLEND_STATE_GROUP>
    <NAME>NoAlpha</NAME>
    <SEPARATE_BLEND>false</SEPARATE_BLEND>
    <TARGET>
      <ID>0</ID>
      <BLEND_ENABLE>false</BLEND_ENABLE>
    </TARGET>
  </BLEND_STATE_GROUP>

  <RAST_STATE_GROUP>
    <NAME>Solid</NAME>
    <CULL_MODE>None</CULL_MODE>
    <FILL_MODE>Solid</FILL_MODE>
    <DEPTH_BIAS>0</DEPTH_BIAS>
    <DEPTH_SLOPE_FACTOR>0</DEPTH_SLOPE_FACTOR>
  </RAST_STATE_GROUP>

  <CONSTANT_BUFFER>
    <NAME>cbCamera</NAME>
  </CONSTANT_BUFFER>

  <CONSTANT_BUFFER>
    <NAME>cbClippingMap</NAME>
  </CONSTANT_BUFFER>

  <STORAGE_IMAGE>
    <NAME>clippingMap</NAME>
    <DECLARATION>
      <TYPE>iimage2D</TYPE>
      <FORMAT>r32i</FORMAT>
      <QUALIFIERS>
        <QUALIFIER>coherent</QUALIFIER>
        <QUALIFIER>restrict</QUALIFIER>
      </QUALIFIERS>
      <OPTION_GRAMMAR>!ImageArray</OPTION_GRAMMAR>
    </DECLARATION>
    <DECLARATION>
      <TYPE>iimage2DArray</TYPE>
      <FORMAT>r32i</FORMAT>
      <QUALIFIERS>
        <QUALIFIER>coherent</QUALIFIER>
        <QUALIFIER>restrict</QUALIFIER>
      </QUALIFIERS>
      <OPTION_GRAMMAR>ImageArray</OPTION_GRAMMAR>
    </DECLARATION>
  </STORAGE_IMAGE>

  <TECHNIQUE>
    <NAME>Default</NAME>
    <PASS>
      <NAME>Pass0</NAME>

      <BLEND_STATE>NoAlpha</BLEND_STATE>
      <DEPTH_STENCIL_STATE>DepthNoTestNoWrite</DEPTH_STENCIL_STATE>
      <RASTERIZER_STATE>Solid</RASTERIZER_STATE>

      <STREAMS>
        <STREAM>
          <STAGES>Vertex_Fragment</STAGES>
          <VARYING>
            <NAME>vOffset</NAME>
            <TYPE>int</TYPE>
            <QUALIFIER>flat</QUALIFIER>
          </VARYING>
          <VARYING>
            <NAME>vMapID</NAME>
            <TYPE>int</TYPE>
            <QUALIFIER>flat</QUALIFIER>
          </VARYING>
        </STREAM>
      </STREAMS>

      <SHADER_OPTIONS>
        <SHADER_OPTION>
          <NAME>PositionAsVec2</NAME>
          <OPTION_VALUE>1</OPTION_VALUE>
        </SHADER_OPTION>
        <SHADER_OPTION>
          <NAME>UseAttribUInt</NAME>
          <OPTION_VALUE>2</OPTION_VALUE>
        </SHADER_OPTION>
      </SHADER_OPTIONS>

      <VERTEX_STAGE>streams ubos DrawClippingMapVS</VERTEX_STAGE>
      <FRAGMENT_STAGE>DrawClippingMapPS</FRAGMENT_STAGE>
    </PASS>
  </TECHNIQUE>

  <TECHNIQUE>
    <NAME>ScreenSpace</NAME>
    <PASS>
      <NAME>Pass0</NAME>
			
      <BLEND_STATE>NoAlpha</BLEND_STATE>
      <DEPTH_STENCIL_STATE>DepthNoTestNoWrite</DEPTH_STENCIL_STATE>
      <RASTERIZER_STATE>Solid</RASTERIZER_STATE>

			<STREAMS>
        <STREAM>
          <STAGES>Vertex_Fragment</STAGES>
          <VARYING>
            <NAME>vOffset</NAME>
            <TYPE>int</TYPE>
            <QUALIFIER>flat</QUALIFIER>
          </VARYING>
          <VARYING>
            <NAME>vMapID</NAME>
            <TYPE>int</TYPE>
            <QUALIFIER>flat</QUALIFIER>
          </VARYING>
        </STREAM>
      </STREAMS>
			
			<SHADER_OPTIONS>
        <SHADER_OPTION>
          <NAME>SCREEN_SPACE</NAME>
          <OPTION_VALUE>1</OPTION_VALUE>
        </SHADER_OPTION>
        <SHADER_OPTION>
          <NAME>PositionAsVec2</NAME>
          <OPTION_VALUE>1</OPTION_VALUE>
        </SHADER_OPTION>
        <SHADER_OPTION>
          <NAME>UseAttribUInt</NAME>
          <OPTION_VALUE>2</OPTION_VALUE>
        </SHADER_OPTION>
      </SHADER_OPTIONS>
			
      <VERTEX_STAGE>streams DrawClippingMapVS</VERTEX_STAGE>
      <FRAGMENT_STAGE>DrawClippingMapPS</FRAGMENT_STAGE>
    </PASS>
  </TECHNIQUE>

</EFFECT>
